package com.supor.aiot.mine.api;

import com.android.baseconfig.base.BaseApiResult;
import com.android.baseconfig.base.BaseRetrofit;

import io.reactivex.rxjava3.core.Observable;

public class WechatImpl extends BaseRetrofit<WechatService> implements WechatService {

    private static WechatImpl instance;

    public static WechatImpl getInstance() {
        if (instance == null) {
            instance = new WechatImpl();
        }
        return instance;
    }


    /**
     *
     * 查询用户微信开关状态接口
     *
     * @return Observable<BaseApiResult<Sting>>
     */
    @Override
    public Observable<BaseApiResult<String>> getWechatOauthStatus(String authorizationType) {
        return api.getWechatOauthStatus(authorizationType).compose(this.applySchedulers());
    }


    /**
     *
     * 用户开启/关闭微信推送接口
     *
     * @return Observable<BaseApiResult<Sting>>
     */
    @Override
    public Observable<BaseApiResult<String>> setWechatOauth(String isOauth) {
        return api.setWechatOauth(isOauth).compose(this.applySchedulers());
    }
}
